package com.zhongyu.comm.util;

import com.zhongyu.comm.vo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 *
 * 控制层全局异常控制器
 */
@RestControllerAdvice
@Slf4j
public class GlobalException {

    @ExceptionHandler(RuntimeException.class)
    public Result hadleException(RuntimeException ex){
            log.error("全局异常处理器捕获到异常！",ex);
        return  Result.failure("用户操作失败");
    }
}
